import { getData, postData } from "@/utils/request";

/**
 * 提交创建志愿活动的信息
 */
export const createActivity = async (info) => {
    return await postData('/serviceVolunteerActivity/submitVolunteerActivity', info);
};

/**
 * 查询志愿活动列表
 */
export const getActivityList = async (page, pageSize) => {
    return await postData('/serviceVolunteerActivity/queryVolunteerActivityItemList', { page, pageSize });
};

/**
 * 志愿活动详情查询
 */
export const getActivityInfo = async (activityId, partyId) => {
    return await getData(`/serviceVolunteerActivity/queryVolunteerActivityItemDetail/${activityId}/${partyId}`);
};

/**
 * 志愿活动报名
 */
export const register = async (applicantId, volunteerActivityId) => {
    return await postData(`/serviceActivityRegistration/register`, { applicantId, volunteerActivityId });
};